planner: prove null-reject for deferred expressions#67789
Conversation
|
Skipping CI for Draft Pull Request. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthroughRemoves the Changes
Sequence Diagram(s)sequenceDiagram
participant Op as Planner Operator (Proj/Agg/Join)
participant IsNull as util.IsNullRejected
participant Proof as proveNullRejected
participant Fold as tryFoldNullifiedConstant
Op->>IsNull: IsNullRejected(ctx, schema, expr)
IsNull->>Proof: start proof (allowNullifiedFold = true)
alt encounter Constant with DeferredExpr
Proof->>Proof: descend into DeferredExpr (allowNullifiedFold = false)
Proof->>Fold: do not attempt nullify-then-fold (blocked)
else other expressions
Proof->>Fold: may attempt nullify-then-fold
end
Proof-->>IsNull: result (null-rejected true/false)
IsNull-->>Op: boolean result
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Skipping CI for Draft Pull Request. |
|
Review Complete Findings: 0 issues ℹ️ Learn more details on Pantheon AI. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #67789 +/- ##
================================================
- Coverage 77.6156% 77.5719% -0.0437%
================================================
Files 1982 1966 -16
Lines 548909 551248 +2339
================================================
+ Hits 426039 427614 +1575
- Misses 122060 123632 +1572
+ Partials 810 2 -808
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
0badcb2 to
e301757
Compare
e301757 to
d592612
Compare
|
/retest |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: qw4990, Reminiscent The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
[LGTM Timeline notifier]Timeline:
|
|
/retest |
1 similar comment
|
/retest |
|
/cherry-pick release-8.5 |
|
@winoros: new pull request created to branch DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
What problem does this PR solve?
Issue Number: close #67788, close #65583
Problem Summary:
Null-reject proof skipped
Constantexpressions withDeferredExprto avoid treating plan-cache-sensitive runtime values as static constants. That was conservative, but it also missed safe symbolic proof opportunities and left a now-obsolete plan-cache compatibility parameter onplanner/util.IsNullRejected.What changed and how does it work?
This PR lets null-reject proof inspect
DeferredExprsymbolically without evaluating or nullify-folding its runtime value.allowNullifiedFoldmode toproveNullRejected. Normal proof still uses the nullify-then-fold bridge. When descending intoConstant.DeferredExpr, the proof keeps using structural null-reject rules but disables nullified folding.ParamMarkerandDeferredExprout of static constant folding candidates.skipPlanCacheCheckargument fromIsNullRejectedand update its callers.Check List
Tests
Unit tests:
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.
Summary by CodeRabbit
Refactor
Tests